package demo01;

import java.io.InputStream;
import java.io.OutputStream;
import java.net.ServerSocket;
import java.net.Socket;

public class ServerDemo {
	public static void main(String[] args) throws Exception {
		ServerSocket ss = new ServerSocket(10090);
        Socket s = ss.accept();
        InputStream is = s.getInputStream();

        byte[] bys = new byte[1024];
        int len;
        len = is.read(bys);
        String str = new String(bys);
        System.out.println(str);
        String upperStr = str.toUpperCase();
        OutputStream os = s.getOutputStream();
        os.write(upperStr.getBytes());
	}

}
